<template>
  <Create @handlePlan="handlePlan" />
</template>

<script lang="ts">
  import { Options, Vue } from "vue-class-component";
  import { useStore } from "vuex";
  import * as types from "@/store/action.types";
  import Create from "./component/create.vue";
  import { message } from "ant-design-vue";
  @Options({
    components: {
      Create,
    },
  })
  export default class Home extends Vue {
    store = useStore();
    public async handlePlan(val: Object) {
      await this.store.dispatch(types.ADD_PLAN, val);
      message.success("操作成功");
    }
    async mounted() {
      await this.store.dispatch(types.GET_PLAN_LIST);
    }
  }
</script>

<style scoped lang="scss">
</style>